package com.jms.activemq;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * @author xiangui
 * 描述: 消息的监听
 * 时间: Create in 19:26 2018/7/24
 */
public class Listener1 implements MessageListener{


    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("订阅者二收到的消息:"+ ((TextMessage)message).getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
